package cn.edu.scut.hsrc.bean;

import cn.edu.scut.hsrc.bean.WordType.Type;

/**
 * 候选词
 * @file CandidateWord.java
 * @author feiyu
 *
 */

public class CandidateWord extends Word{
	
	private final int pos;		//该候选词在全局词集合中的下标
	private int comunity;     //用于标记该词语属于哪一类；

	/**
	 * 
	 * 构造函数
	 * @param text	词
	 * @param type	词性
	 * @param relationToQuery 和查询词之间的关系
	 * @param pos	该候选词在全局词集合中的下标
	 */
	public CandidateWord(String text, Type type,RelationToQuery relationToQuery,int pos,int community) {
		super(text, type,relationToQuery);
		// TODO Auto-generated constructor stub
		this.pos = pos;
		this.comunity=community;
	}
	
	/**
	 * 
	 * 构造函数
	 * @param word	词
	 * @param pos	该词在全局词集合中的下标
	 */
	public CandidateWord(Word word,int pos,int cominity) {
		super(word);
		// TODO Auto-generated constructor stub
		this.pos = pos;
		this.comunity=cominity;
	}
	
	/**
	 * 
	 * 构造函数
	 * @param candidateWord
	 */
	public CandidateWord(CandidateWord candidateWord) {
		// TODO Auto-generated constructor stub
		super(candidateWord);
		this.pos = candidateWord.pos;
		this.comunity=candidateWord.comunity;
	}
	
	/**
	 * 返回该候选词在全局词集合中的下标
	 * @return
	 */
	public int getPos()
	{
		return this.pos;
	}
	
	public int getComunity(){
		return comunity;
	}
	
	public void setComunity(int comunity){
		this.comunity=comunity;
	}
}

